/**
 * @author monirul
 */

var GameCardModel =  Class.create({
	
	initialize: function(){
		this._id;
		this._name;
		this._displayName;
		this._distance;
		this._cardType;
		this._isActive;
		this._isSelected;
	},
	
	init:function(o){
		if(o.id) this._id = o.id;
		if(o.name) this._name = o.name;
		if(o.displayName) this._displayName = o.displayName;
		if(o.distance) this._distance = o.distance;
		if(o.cardType) this._cardType = o.cardType;
		if(o.isActive) this._isActive = o.isActive;
		
		this.gameCardActivated = new Event(this);
		this.gameCardInitialized  = new Event(this);
		this.gameCardSelected  = new Event(this);
	},
	
	getCardId:function(){
		return this._id;
	},
	
	getCardName:function(){
		return this._name;
	},
	
	getCardDisplayName:function(){
		return this._displayName;
	},
	getCardDistance:function(){
		return this._distance;
	},
	getCardType:function(){
		return this._cardType;
	},
	isActive:function(){
		return this._isActive;
	},
	
	setActive: function(isActive) {
		this._isActive = isActive;
		this.gameCardActivated.notify({});
	},
	
	initializeCard:function(){
		this.gameCardInitialized.notify({});
	},
	
	setSelected:function(isSelected){
		this._isSelected = isSelected;
		this.gameCardSelected.notify({'selectedCardId':this._id});
	},
	
	isSelected:function(){
		return this._isSelected;
	}
	
	
	
	
});
